package work10;

import static sun.management.MemoryNotifInfoCompositeData.getCount;

public class Task02 {
    public static void main(String[] args) {
        System.out.println("woaijava,wozhendeaijava,wozhendehenaijavawoaijava");
        String maxString="woaijava,wozhendeaijava,wozhendehenaijavawoaijava";
        String minString="java";
        int count=0;
        for (int i = 0; i <maxString.length() ; i++) {
            if (maxString.length()-i >= 4){
                String str = maxString.substring(i,i+4);
                if (str.equals(minString)){
                    System.out.println(str);
                    count++;
                }
            }
        }

        System.out.println(count);
    }




}
